﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;

namespace MShop.Core.Domain
{
    [MetadataType(typeof(ShopUsersAddress_Validation))]
    public partial class ShopUsersAddress
    {
        public ShopUsersAddress()
        {
            this.Created = DateTime.Now;
        }
    }


    internal partial class ShopUsersAddress_Validation
    { 

       [DisplayName("移动电话")]
       public string Mobile { get; set; }

       [Foolproof.RequiredIfEmpty("Mobile", ErrorMessage = "固定电话,移动电话必须要填写其中一个")]
       [DisplayName("固定电话")]
       public string Tel { get; set; }

        
       [UIHint("AreaControl")]
       [DisplayName("地区")]
       public int AreaId { get; set; }

       [Required(ErrorMessage = "联系人姓名不能为空")]
       [DisplayName("联系人姓名")]
       public string ReceiverName { get; set; }

       [DisplayName("是否默认地址")]
        public bool IsDefault { get; set; }

        [Required(ErrorMessage = "邮政编码不能为空")]
        [DisplayName("邮政编码")]
        public string Postcode { get; set; }

          [Required(ErrorMessage = "固定地址不能为空")]
        [DisplayName("固定地址")]
        public string Location { get; set; } 

        [DisplayName("备注")]
        [DataType(DataType.MultilineText)]
        public string Memo { get; set; }
    }
    
}